package ericXie.com.component 
{
	import ericXie.com.model.MainModel;
	import flash.display.MovieClip;
	import flash.events.Event;
	
	/**
	 * ...中心旋转区域
	 * @author EricXie
	 */
	public class HaloMovieClip extends MovieClip 
	{
		
		public var _halo:MovieClip;
		private var _startRoulette:Boolean;
		private var _model:MainModel=MainModel.getInstance();
		
		public function HaloMovieClip() 
		{
			this.addEventListener(Event.ADDED_TO_STAGE,addStageHandler)
		}
		
		private function addStageHandler(e:Event):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, addStageHandler);
			_halo = _model.extractionElements("Halo") as MovieClip;
			this.addChild(_halo);
			startRoulette = true;
		}
		//设置中心旋转区域，如果为真时在第一帧，否则为第二帧状态。
		public function get startRoulette():Boolean 
		{
			return _startRoulette;
		}
		
		public function set startRoulette(value:Boolean):void 
		{
			_startRoulette = value;
			if (this.contains(_halo)) {
				if (_startRoulette) {
					_halo.gotoAndStop(1);
				}else
				{
					_halo.gotoAndStop(2);
				}
			}
		}
		
	}

}